var a = [1,2,2,1];// 数组
var b = {a:1,b:2,c:2,d:true,e:[0,1,2,3,true,{name:"李四"}]};// 对象
var student = {name:"张三",age:18}
student.sex = "男";
student.age2 +=2;
student.age = 20;

console.log(a[0]);
console.log(b["b"]);
console.log(b.b);
b.e[5].sex = "男";
console.log(b.e[5]);

var class2 = {
    nianji:2,
    student:[
        {name:"s1", sex:"男", age:18},
        {name:"s2", sex:"男", age:18},
        {name:"s3", sex:"男", age:18}
    ],
    teacher:"张三"
};
console.log(class2);
for (var i = 0; i < 10; i++) {
    class2.student.push({name:"ss" + i, sex:"男", age:18})
}
console.log(class2);

var school = {
    xiaozhang:"xz1",
    class:[
        {
            nianji:2,
            student:[
                {name:"s1", sex:"男", age:18},
                {name:"s2", sex:"男", age:18},
                {name:"s3", sex:"男", age:18}
            ],
            teacher:"张三"
        },{
            nianji:2,
            student:[
                {name:"s1", sex:"男", age:18},
                {name:"s2", sex:"男", age:18},
                {name:"s3", sex:"男", age:18}
            ],
            teacher:"张三"
        }
    ]
};
console.log(typeof(school));
console.log(typeof(school.class));


var s = {name:"s1"}
// var keyName = "name";
console.log(s.name)
console.log(s["name"])
console.log(s[keyName])
